<html>
  <head>
    <script type="text/javascript" src="https://pubnub.github.io/eon/v/eon/1.0.0/eon.js"></script>
    <link type="text/css" rel="stylesheet" href="https://pubnub.github.io/eon/v/eon/1.0.0/eon.css"/>
  </head>
  <body>
    <div id="chart"></div>
    <script>
    var pubnub = new PubNub({
        publishKey: 'your_pub_key',
        subscribeKey: 'your_sub_key'
      });

      var channel = "c3-spline-history-test";

      eon.chart({
        channels: [channel],
        history: true,
        flow: true,
        pubnub: pubnub,
        generate: {
          bindto: '#chart',
          data: {
            labels: false
          }
        },
        transform: function(a) {
          return {
            eon: {
              'Austin': a[0],
              'New York': a[1],
              'San Francisco': a[2],
              'Portland': a[3]
            }
          };
        }
      });
    </script>
    <script>
      setInterval(function(){

        pubnub.publish({
          channel: channel,
          message: [
            Math.floor(Math.random() * 99),
            Math.floor(Math.random() * 99),
            Math.floor(Math.random() * 99),
            Math.floor(Math.random() * 99)
          ]
        });

      }, 1000);
    </script>
    </script>
  </body>
  </body>
</html>
